# open
# open(file ,mode='r',)
# file 指定打开文件
#


# 文件打开方式##########3
# 默认（只读）


# ##########with语句关键字 管理###########
from typing import TextIO

# with open("test1.txt", "r") as f:
#     # for i in f:
#     #     print(i)
#     print(f.read())

# #####文件读取
# read
# readline
# readlines
with open("test1.txt", "r") as f:
    for i in range(5):
        print(f.readline())
    f.seek(0)
    str1 = f.read()
    print(str1)
    f.seek(-12, 2)
    print(f.read().decode("utf-8"))


